package cn.hncu.booksManagementSystem.stock.vo;

import java.io.Serializable;

/**
 * CreateTime: 2018年4月19日 下午7:26:31	
 * @author 宋进宇  Email:447441478@qq.com
 * Description:
 *	库存值对象
 */
public class StockModel implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private String id; //库存编号 --- 主键
	private String bookId; //图书编号 ---外键
	private String bookName; //专为图书编号补的一个属性，面向用户
	
	private int sumNum; //库存数量
	public StockModel() {
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getBookId() {
		return bookId;
	}
	public void setBookId(String bookId) {
		this.bookId = bookId;
	}
	public int getSumNum() {
		return sumNum;
	}
	public void setSumNum(int sumNum) {
		this.sumNum = sumNum;
	}

	public String getBookName() {
		return bookName;
	}

	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		StockModel other = (StockModel) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "库存编号："+id+"图书编号："+bookId+" ,《"+bookName+"》,"+sumNum+"本";
	}
}
